<script setup lang="ts">
import { onMounted, reactive } from 'vue'
import { get } from '@/utils/api'

const date = new Date().getFullYear()

const data = reactive({
  copyright: '济南市猫玖鱼柒网络科技有限公司',
  icp: '鲁ICP备2022014288号-3'
})
const getConfig = async () => {
  try {
    const response = await get('/api/copyright/getConfig')
    if (response === null) {
      console.log('null')
    }
    Object.assign(data, response)
  } catch (err) {
    console.log(err)
  }
}
onMounted(async () => {
  await getConfig()
})
</script>

<template>
  <t-row>
    <p>
      <span>Copyright&nbsp;©&nbsp;{{ date }}&nbsp;{{ data.copyright }}</span>
      <span
        ><a href="https://beian.miit.gov.cn/#/Integrated/recordQuery" target="_blank"
          >&nbsp;{{ data.icp }}</a
        ></span
      >
    </p>
  </t-row>
</template>

<style scoped lang="sass">
.t-row
  height: 100%
  display: flex
  justify-content: center
  align-items: center
  text-align: center
  color: #909399
  p
    display: flex
    flex-wrap: wrap
    span
      flex: auto
</style>
